<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>时间方法</title>
</head>
<body>
<script>
let times = new Date();
/*获取小时*/
let hours = times.getHours();
/*获取分钟*/
let minute = times.getMinutes();
/*获取秒数*/
let second = times.getSeconds();
/*得到毫秒数,返回1970-1-1至今的毫秒数    作用:使用毫秒数做缓存处理*/
let time = times.getTime();
document.writeln("小时:" + hours);
document.writeln("分钟:" + minute);
document.writeln("秒数:" + second);
document.write("毫秒数:" + time);
</script>
</body>
</html>
